import Vue from 'vue'
import Vuex from 'vuex'
import persistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: '',
    userInfo: null
  },
  mutations: {
    setToken(state,token) {
      state.token = token
    },
    setUserInfo(state,userInfo) {
      state.userInfo = userInfo
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [
    persistedState({ storage: window.sessionStorage })
]
})
